dxp-ux

(0 reviews)

Create PaymentMethod-V2 (TMF-670) towards SFDC

Create a Payment Method in Salesforce

URL
https://[localhost]:[port]/dxp-ux/v2/{businessId}/paymentMethod
URL PARAMS
nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR, CR etc.) identifying the business unit.Y
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel. Minimum characters: 5Y
client_secretstringPassword associated with the client_id. Minimum characters: 5Y
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server.
Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.
Y

Request

{
    "@baseType": "PaymentMethod",
    "@type": "TokenizedCard",
    "name": "TokenizedCard",
    "account": [
        {
            "id": "31516278-31514752",
            "@type": "BillingAccount"
        }
    ],
    "token": "cGF5bWVudG1ldGhvZF9jY181a25obmtzZg",
    "characteristics": [
        {
            "name": "MSISDN",
            "value": "12401231232"
        },
        {
            "name": "paymentGatewayType ",
            "value": "BrainTreeToken"
        },
        {
            "name": "channel",
            "value": "Digital"
        },
        {
            "name": "restrictOrder",
            "valueType": "Boolean",
            "value": true
        }
    ]
}

Note - either msisdn or billingAccountNumber is mandatory

Definitions

Each of the request parameters is detailed.

nametypedescriptionrequired
tokenstringpayment method token from payment gatewayY
namestringName assigned to the payment methodN
accountarrayReference to the accounts that are linked to the payment method.Y*
account.idstringbilling account number (BAN-CAN)
Conditional Mandatory (either msisdn or billingAccountNumber is mandatory)
Y*
account.@typestringtype of account.N
characteristicsarrayA list of characteristics. Describes the characteristic of a billing account user.Y
characteristics.namestringName of the characteristicsY
characteristics.valuestringvalue of the characteristicsY
characteristics.valueTypestringValue type of the characteristicsN
@typestringType of payment method. Eg.: TokenizedCard, etc
Note - this is for ESB internal, not passing to Salesforce (end system)
N
@basetypestringWhen sub-classing, this defines the sub-class entity name, in this case 'PaymentMethod'
Note - this is for ESB internal, not passing to Salesforce (end system)
N
Characteristic values
Characteristic nametypedescriptionrequired
MSISDNstringMobile Device number.
Conditional Mandatory (either msisdn or billingAccountNumber is mandatory)
Y*
paymentGatewayTypestringpayment method gateway type, Eg: BrainTreeTokenY
channelstringSource System information for tracking purpose. Expected values 'Digital'Y
restrictOrderbooleanrepresents the flag to retrict order or not. The expected values "true / false (default false)"N

Response

In this section all the possible data structures received by the client at the moment of responding the method are defined.

Possible response success

This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.

[ 201 ]

OK - POST payment request processed successfully, response body contains an entity corresponding to the requested resource.

{
    "description"- "payment method create request received"
}
Definitions
nametypedescriptionrequired
descriptionstringAcknowledges the create payment method requestN
Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]

Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

{
  "errors" : [{
      "code" : 400,
      "message" : "Bad Request",
      "description" : "The request is not formed properly"
    }]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the tarPOST resource.

{
  "errors" : [{
      "code" : 401,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the tarPOST resource"
    }]
}
[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
  "errors" : [{
      "code" : 404,
      "message" : "Resource not Found",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method POST not allowed for : /{businessId}/payment"
        }]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
  "errors" : [{
      "code" : 500,
      "message" : "The request failed due to an internal error.",
      "description": ""
    }]
}
[ 501 ]

Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

{
  "errors" : [{
      "code" : 501,
      "message" : "Not implemented",
      "description" : "Operation POST /payment for Business Id: xxxx not implemented"
    }]
  }

Reviews